Repository navigation
refactor(ui)!: retire test-only barrel helpers, CommentSearchResult and four dead publicForm keys - #28544
Conversation
…nd four dead publicForm keys - core: resetActionKeyWarnings leaves the package entry (actions barrel re-exports actionKeys by name) - react: __resetVisibilityPredicateWarnings leaves the package entry; nine cross-package tests import it from its declaring module - plugin-detail: resetUnknownActivityTypeWarnings leaves the package entry; its one cross-package test imports the declaring module - types: CommentSearchResult is deleted; its record-id pin drops the row - i18n: publicForm.consentRequired/rateLimited/redirectBlocked/requiredHint leave all ten packs Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKqWksC1TiqsHCrrU
|
domain:ui#1 · os-tesla · session_01L9qibw2uhdSeHYfnZdAf4V Contract reviewServed-tier: ① Derived judgmentsPublic-surface changes the diff implies, each read against the cited code on
② Semver levelFive changesets, one per package whose entry narrows, each ③ Boundary flags
④ Design judgmentThe narrowing, read against the published entries on
Implemented-by: VERDICT: FAIL |
…d true - the pending collaboration changeset no longer points hosts at CommentSearchResult, which leaves @object-ui/types in the same release; it gives the local shape instead - the i18n changeset says EmbeddableForm keeps its English literal defaults for the deleted publicForm keys' wording - the react barrel comment no longer names the reset it stopped exporting Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzKqWksC1TiqsHCrrU
|
domain:ui#1 · os-tesla · session_01L9qibw2uhdSeHYfnZdAf4V Contract reviewServed-tier: ① Derived judgmentsThe delta commit changes no code surface: three files, +5/−5, all comment or changeset prose. Every entry, type and key judgment in 6554050725 holds unchanged on this head.
② Semver levelUnchanged: five ③ Boundary flags
④ Design judgmentThe narrowing is unchanged from 6554050725 and holds: the three reset helpers leave entries that keep every diagnostic, prefix and dedupe public; Implemented-by: VERDICT: PASS |
|
domain:ui#1 · os-tesla · session_01L9qibw2uhdSeHYfnZdAf4V Deliberate correction of a pending release note: needs the maintainer's confirmation.
This was the contract record's must-fix, 6554050725. The delta record, 6554291417, is a PASS on |
|
domain:ui#1 · os-tesla · session_01L9qibw2uhdSeHYfnZdAf4V 席位意见:同意。五个 ui 包的公共入口拿掉零消费者面(三个测试用 reset 助手、 席位核对ACCEPT · head
|
…yCache from the entry (objectstack-ai#33666) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X4J9JiPq8zKVvbcBFubCvK6)_ Part of objectstack-ai#25921 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none (the name appears under neither `skills/**` nor `content/docs/**`) ## 维护者速读 - 改了什么:`@object-ui/data-objectstack` 的根入口不再导出只给测试用的 `clearSharedDiscoveryCache`(清空适配器按来源缓存的 discovery 文档)。缓存这一小段代码原样搬进包内新模块 `sharedDiscovery.ts`,`getSharedDiscovery` 照旧从入口导出;38 个测试改为从该模块直接引入。这是 objectstack-ai#25921 第 18 批,补完卡上「reset* 测试助手移出公共入口」那一条的最后一项(前 8 个早已移出)。 - 为什么改:两个仓库里除测试外没有任何代码、文档或技能调用它;留在入口上会被当成公开 API 承诺。做法与之前移出 `resetRuntimeConfigForTesting`、`__clearRecordEditableCache` 等助手一致。 - 风险与回滚:运行时行为零变化(搬移是逐字的,适配器仍走同一份缓存);测试断言一行未改。外部 npm 宿主若从入口 import 这个助手会编译失败(未实测,changeset 写了 BREAKING 与替代写法)。`!` patch,回滚即 revert 本 PR。 - 先看:`ui/packages/data-objectstack/src/sharedDiscovery.ts`、`ui/packages/data-objectstack/src/index.ts`(缓存段与新增 import)、`.changeset/25921-data-objectstack-shared-discovery-cache-helper.md`。 - 两分钟验证:`node scripts/check-adr-0087-registration.mjs --base origin/main`,预期该名字 `verified`、退出 0。 - 需要你做的:无,席位落地。 ## What changes Batch 18 as named in the seat's amendment 6888438983 on claim 6888311800 (census `/mnt/project-files/pm-orders/ui/25921-b18-census.md`, objectstack `origin/main` `6e287974`, hotcrm `2492ac6`). - **New `ui/packages/data-objectstack/src/sharedDiscovery.ts`**: the per-origin discovery cache block (the `discoveryCache` Map, `getSharedDiscovery`, `clearSharedDiscoveryCache`), moved verbatim from `index.ts` under a short module header. - **`ui/packages/data-objectstack/src/index.ts`**: imports `getSharedDiscovery` from the module for `ObjectStackAdapter.connect()` and re-exports it unchanged. `clearSharedDiscoveryCache` leaves the entry; in its place sits the "test-only and stays off the barrel" comment its siblings carry in app-shell, types and plugin-detail. `serverOriginOf`, which sat between the moved lines, stays in `index.ts`. - **38 test files, import lines only**: 28 in `data-objectstack/src` now import the helper from `./sharedDiscovery`; 10 in console (4), app-shell (4) and react (2) import it by relative source path, the spelling those packages already use for `resetRuntimeConfigForTesting`, `resetInflightGetsForTesting` and `__clearRecordEditableCache`. ui vitest aliases `@object-ui/data-objectstack` to the package `src`, so the adapter and the helper resolve to one module instance. No assertion changes. - **`ui/packages/app-shell/src/views/metadata-admin/previews/canvasDataSource-27585.test.tsx`**, beyond its import line: two module-top side-effect imports, `@objectstack/lint` and `@objectstack/formula`, that `check:test-source-alias` asks of an edited test reaching those lazy loads (see Verification, round 1). The amendment named import-line edits only; this is the gate's prescribed fix for a file the batch had to touch. - **Changeset** `.changeset/25921-data-objectstack-shared-discovery-cache-helper.md`: `!` patch, BREAKING, FROM/TO, one `runtime-export-retired` marker (FROM spans 1:1), both declaration lines. ## Why The card's recommendation "Move the nine `reset*` helpers into `@object-ui/test-support` or tag them `@internal`" was done for eight helpers (objectui#13453 and objectstack-ai#28544); `clearSharedDiscoveryCache` was left as item B2 and carried as open in the landing notes through objectstack-ai#31056. The census found zero non-test callers in either repo, and no README, docs page, skill, changeset or CHANGELOG naming it. ## Tests - Census (one `rg -w -F` pass per repo): the helper's only hits outside the package are the 10 test files above; hotcrm 0. Positive control in the same block: `getSharedDiscovery` has non-test readers outside the package (`ui/apps/console/src/languageSeed.ts`, `ui/packages/app-shell/src/chrome/ConditionalAuthWrapper.tsx`) and stays exported. - Reverse probe: the TypeScript checker's export list of `src/index.ts` goes 127 → 126, exactly `clearSharedDiscoveryCache` gone, nothing added. The built `dist/index.js`, imported at runtime, has no `clearSharedDiscoveryCache` key and still has `getSharedDiscovery` and `ObjectStackAdapter`. A probe compiled against the built `dist/index.d.ts` answers TS2305 for the helper and nothing on the control line (`getSharedDiscovery`, `ObjectStackAdapter`). - Under the lock: `pnpm --workspace-concurrency=2 --filter '@object-ui/data-objectstack...' build` then its `type-check` (its tsconfig includes the in-package tests): VERDICT command-exit 0. `--filter '@object-ui/console...' build` then `type-check` of `@object-ui/react`, `@object-ui/app-shell` and `@object-ui/console` (each runs its `tsconfig.test.json` or equivalent): VERDICT command-exit 0. - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/data-objectstack/` plus the 10 cross-package test files, under the lock: VERDICT command-exit 0, Test Files 131 passed (131), Tests 1475 passed (1475). - No test added or removed, and no ablation: the diff moves code verbatim and unexports one test-only helper; no tested behaviour changes. ## Acceptance notes - The moved helper keeps its original one-line JSDoc ("Test/dev helper to drop the cache (e.g. on logout or origin change)"), verbatim per the amendment; nothing outside tests calls it. - Follow-ups noted on the claim amendment, not in this batch: the `runner` move under `apps/` or `examples/`, and 57 newly CONFIRMED i18n keys that are not the card's 122. ## Verification <details><summary>Derived gates on HEAD 85ef16b (38/38, all exit 0, --ran reconciled)</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran ran.list` (each line `CMD :: exit N`) → "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)". Each command ran with stdin closed and its exit code captured before any pipe. - `node scripts/check-adr-0087-registration.mjs --base origin/main` exit 0: `not-required (runtime-export-retired) -- verified: @object-ui/data-objectstack#clearSharedDiscoveryCache`; `--self-test` exit 0 - `node scripts/check-changeset-no-major.mjs --base origin/main`, `check-empty-changeset.mjs --base origin/main` (+ `--self-test`), `check-closing-keyword-parity.mjs` (+ `--self-test`), `check-comment-mask-corpus.mjs`, `check-sdui-manifest.mjs` (+ `--self-test`), `ci/snapshot-next.mjs --self-test`, `pm/release-rehearsal-clone.mjs --self-test`, `release-pending-publish.mjs --self-test`: exit 0 - `pnpm --dir ui exec vitest run scripts/` under the lock → Test Files 171 passed | 2 skipped (173), Tests 5062 passed | 2 skipped (5064) - `pnpm check:type-check-debt` under the lock → exit 0 ("0 raw tsc error(s) total, none above its recorded number") - `pnpm check:cross-package-test-inputs` exit 0 ("32 package(s) read outside themselves, all declared") - `pnpm check:test-source-alias` exit 0 (see round 1 below) - `pnpm --filter @objectstack/spec run check:duration-unit-keys`, `check:error-code-provenance`; `pnpm check:changeset-gate-self-tests`, `check:closed-ceremony-text`, `check:dispatcher-error-vocabulary`, `check:driver-memory-census`, `check:engine-double-contract`, `check:error-status-conformance`, `check:gitlink-declared`, `check:nul-bytes`, `check:published-files`, `check:query-options-erasure`, `check:refd-timer-probe`, `check:registry-log-declared`, `check:rest-log-spy-declared`, `check:skill-identifier-liveness`, `check:tier-file-adoption`, `check:type-check-coverage`, `check:undeclared-dep-imports`, `check:watch-hint-literal`, `check:where-matcher`: exit 0 Round 1 on 20126db (same 38): 37 exit 0, `pnpm check:test-source-alias` exit 1. It judges a test file a change edits, and the edited `canvasDataSource-27585.test.tsx` reaches `import('@objectstack/lint')` and `import('@objectstack/formula')` inside function bodies (the object picker under the dataset form). Commit 85ef16b adds the two module-top side-effect imports the gate prescribes, the spelling three `AppContent.*` tests in app-shell already use; that file then passes 5/5 under the lock, and the whole list was rerun on 85ef16b above. Outside the derivation: `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0 (0 anchored files); `pnpm --dir ui run check:new-line-citations` exit 0 (0 new citations). </details> <details><summary>Full dogfood battery on HEAD 85ef16b</summary> `bash scripts/pm/os-verify-lock.sh -c "pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build && pnpm --filter @objectstack/dogfood test"` → `os-verify-lock: VERDICT command-exit 0` (held 41m18s) · Test Files 467 passed | 3 skipped (470) · Tests 3953 passed | 42 skipped (3995) · no failure. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (one module file, `sharedDiscovery.ts`, camelCase like its siblings) - [x] 3. No formatter ran; `pnpm lint` passes. (lint is CI's run) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (the 维护者速读 block is the fleet's required Chinese summary) --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5oqJ6hpya34gYbwBaJ)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5oqJ6hpya34gYbwBaJ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Tesla · project thread
Part of #25921 (items B1, B3, B4, B6 and B10 of the card thread's ledger, claim 6553495326; the card's other open items stay on it)
Clause-②: no (narrowing)
Metadata-protocol: none
维护者速读
resetActionKeyWarnings、react 的__resetVisibilityPredicateWarnings、plugin-detail 的resetUnknownActivityTypeWarnings(三个都是只给测试用的「清掉只警告一次的记忆」助手),types 的CommentSearchResult接口(唯一生产者早已退役),以及十个语言包里四个没有任何界面读取的publicForm.*文案。examples/**与 hotcrm 中都没有非测试读者,留在入口上只会被当成公开 API 承诺。!changeset 写明替代写法。回滚即 revert 本 PR。ui/packages/core/src/actions/index.ts(export *改为具名列表,少了 reset);ui/packages/types/src/__tests__/record-id-string-survivors-10078.test.ts(钉子去掉一行);.changeset/25921-*.md五个文件。git grep -n -w -e resetActionKeyWarnings -e __resetVisibilityPredicateWarnings -e resetUnknownActivityTypeWarnings -- 'ui/packages/*/src/index.ts*'只剩三行「test-only and stays off the barrel」注释;git grep -w CommentSearchResult -- ui/packages无结果。What changes
@object-ui/core:actions/index.tsre-exported./actionKeys.jswithexport *, which put the test seamresetActionKeyWarningson the package entry. It now re-exports the module's other ten names by name. Core's own tests already import the helper from../actionKeys.@object-ui/react:__resetVisibilityPredicateWarningsleaves the entry. Nine cross-package tests imported it from@object-ui/react(the ledger said five; the import scan on the branch found nine) and now import it fromreact/src/utils/visibilityDiagnostic, the same module the vitest alias resolves the entry to, so the reset still clears the instance the code under test reads. Four app-shell tests already used that path.@object-ui/plugin-detail:resetUnknownActivityTypeWarningsleaves the entry; its one cross-package test (RecordDetailView.activityUnmappedType-5896) importsplugin-detail/src/renderers/recordActivityFeed. The entry's docblock sentence that justified exporting it goes with it.@object-ui/types:CommentSearchResultis deleted fromviews.tsand the entry. Its only producer,useCommentSearchin collaboration, retired in refactor(ui)!: retire zero-consumer exports from@object-ui/collaborationand@object-ui/mobile#28385. The record-id pinrecord-id-string-survivors-10078keeps its two other shapes (RecordSubscription.recordId,DataSourceMutationEvent.id) with their type rows, value controls and census rows.@object-ui/i18n:publicForm.consentRequired,rateLimited,redirectBlockedandrequiredHintleave all ten packs (40 lines).ui/scripts/check-i18n-dead-keys.mjslists all four CONFIRMED; the form page reads the nine siblingpublicFormkeys, none of these.patchwith a BREAKING banner, both declaration lines and an ADR-0087 disposition (runtime-export-retiredfor the four exports,no-migration-prescriptionfor the keys).Zero-consumer readings (ledger
/mnt/project-files/ui-seat-1/r2026-10-31b/out/25921-ledger.md, objectstackefb1620c, hotcrma598256, positive controlsSchemaRenderer1,198 files anduseRecordPresence113): each name has no non-test reader outside its package; every import of the four names on this branch was re-read from the import statements themselves.Verification
Head
fef5795d(branch pointeeec88d1).Tests
pnpm --dir ui exec vitest run packages/core/src/actions/ packages/react/ packages/plugin-detail/ packages/types/ packages/i18n/plus the ten edited cross-package test files: Test Files 1022 passed, 7 failed, 1 skipped (1030). All seven reds readno module symbol for packages/spec/dist/...d.mtsor the spec export probe: the closure had been built withOS_SKIP_DTS=1. Afterpnpm --filter @objectstack/spec buildwith declarations, the seven files rerun: 7 passed, 184 tests passed.pnpm turbo run type-checkfor types, core, react, plugin-detail, i18n, components, app-shell and console (each package's owntsc --noEmitplus itstsconfig.test.json, so the pin's compile-time rows and every repointed test are compiled): 78/78 tasks successful, lock VERDICT command-exit 0.pnpm --dir ui exec vitest run scripts/: 169 files passed, 2 skipped; 4901 tests passed.Gates
dispatch-gates --commands: 34 commands, all run with stdin closed, each exit recorded before any pipe;--ran: 34 derived, 34 run, 0 NOT-MEASURED. All exit 0.check:type-check-debtfirst exited 3 (prerequisite: run during the build) and exits 0 on rerun (0 entries above their recorded number).check-adr-0087-registration --base origin/main: 5 declared-breaking changesets, each with a verified disposition.check-sdui-manifestexit 0;check-platform-checklist --changed-from origin/mainexit 0 (0 anchored files);uicheck:new-line-citationsexit 0 (0 new).dispatch-gates --tier: no path-derived mandate; 194 changed lines (+104 / -90), under the 3,000 threshold. No governed path.Acceptance notes
__resetVisibilityPredicateWarnings; it is nine (multi-line imports the first scan missed). All nine are repointed here, same item, same file class.clearSharedDiscoveryCache), B5 (resetRetiredDashboardNodeTypeReports, declared published on purpose), B7 (S3/Azure upload adapters), B8 and B11 (governed), B9, B12, B13.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (lint is CI's run)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibzKqWksC1TiqsHCrrU
Generated by Claude Code